package com.example.api.mapper;

import com.example.api.pojo.Category;
import com.example.api.pojo.Food;
import com.example.api.query.CategoryQuery;
import com.example.api.query.FoodQuery;
import com.example.api.vo.CategoryVO;
import com.example.api.vo.FoodVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface FoodMapper {

    List<FoodVO> find(FoodQuery foodQuery);

    void add(Food food);
    FoodVO findById(long id);

    void update(Food food);
//
//    @Delete("delete from t_food where id = #{id}")
//    void deleteById(long id);

    @Select("select count(*) from t_food where category_id = #{categoryId}")
    int findCountByCategoryId(long categoryId);
}
